package algorithm.quartile;
/**
 * This class represents the distance between a point in space and
 * a globally known point, or in this case a centroid. Maintains the
 * index of the point and the distance to the centroid.
 * 
 * @author Dan Avila
 *
 */
public class Distance_Centroid extends Distance
{
	protected int index;
	/**
	 * Creates a new Distance_Centroid based on a single point to a pre-defined point (centroid)
	 * 
	 * @param index - the index of the point that represents the distance to the centroid
	 * @param distance - the distance to the centroid from this point.
	 */
	public Distance_Centroid(int index, double distance)
	{
		this.index = index;
		this.distance = distance;
	}
	/**
	 * 
	 * @return
	 */
	public Integer getIndex()
	{
		return this.index;
	}
	
	@Override
	public Double getDistance() 
	{
		return this.distance;
	}
}
